import request from '@/utils/request'

// 获取所有作品列表
export function getArtworks() {
  return request({
    url: '/artworks',
    method: 'get'
  })
}

// 根据ID获取作品详情
export function getArtworkById(id) {
  return request({
    url: `/artworks/${id}`,
    method: 'get'
  })
}

// 根据分类获取作品列表
export function getArtworksByCategory(category) {
  return request({
    url: '/artworks',
    method: 'get',
    params: { category }
  })
}

// 搜索作品
export function searchArtworks(keyword) {
  return request({
    url: '/artworks/search',
    method: 'get',
    params: { keyword }
  })
}